﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProtocolConversion_WINCE
{
    class GPS
    {
        public static void SegmentMessage(byte[] date, int length, string cmd)
        {
            //检查校验字
            //if (Form1.CompareDate(Converter.TakeOutByteNoOrder(date, length - 2, 2), Form1.CalculateCheckByte(date)))
            //未收到GPS信号
            if (Converter.BytesToUInt16(date, 12) == 1)
            {
                //将数据填充到协议当中
                Form1.FillDate(new byte[] { 0x11, 0x11 }, 22, 2);
            }
            else
            {
                //将数据填充到协议当中
                Form1.FillDate(new byte[] { 0xff, 0xff }, 22, 2);
            }
        }
    }
}
